﻿Public Class Contacto
    Private _nombre As String
    Public Property Nombre() As String
        Get
            Return _nombre
        End Get
        Set(ByVal value As String)
            _nombre = value
        End Set
    End Property

    Private _apellido As String
    Public Property Apellido() As String
        Get
            Return _apellido
        End Get
        Set(ByVal value As String)
            _apellido = value
        End Set
    End Property

    Private _fechaNacimiento As Date
    Public Property FechaNacimiento() As Date
        Get
            Return _fechaNacimiento
        End Get
        Set(ByVal value As Date)
            _fechaNacimiento = value
        End Set
    End Property

    Private _email As String
    Public Property Email() As String
        Get
            Return _email
        End Get
        Set(ByVal value As String)
            _email = value
        End Set
    End Property

    Private _categoria As Categoria
    Public Property Categoria() As Categoria
        Get
            Return _categoria
        End Get
        Set(ByVal value As Categoria)
            _categoria = value
        End Set
    End Property

    Private _sexo As Sexo
    Public Property Sexo() As Sexo
        Get
            Return _sexo
        End Get
        Set(ByVal value As Sexo)
            _sexo = value
        End Set
    End Property
End Class

Public Class Categoria
    Private _contactos As New List(Of Contacto)
    Public Property Contactos() As List(Of Contacto)
        Get
            Return _contactos
        End Get
        Set(ByVal value As List(Of Contacto))
            _contactos = value
        End Set
    End Property


    Public Sub AddNewContacto(ByVal contacto As Contacto)
        _contactos.Add(contacto)
        contacto.Categoria = Me
    End Sub

    Public Sub RemoveContacto(ByVal contacto As Contacto)
        _contactos.Remove(contacto)
        contacto.Categoria = Nothing
    End Sub

    Private _nombre As String
    Public Property Nombre() As String
        Get
            Return _nombre
        End Get
        Set(ByVal value As String)
            _nombre = value
        End Set
    End Property
End Class

Public Enum Sexo
    Masculino
    Femenino
    SinEspecificar
End Enum